package com.czmh.etc.onlinepubsys.feign.newrun;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import com.czmh.etc.onlinepubsys.feign.newrun.constans.NewrunConstants;
import com.czmh.etc.onlinepubsys.feign.newrun.entity.yunnan.EtcYnApplyInfoVO;
import com.czmh.etc.onlinepubsys.feign.newrun.entity.yunnan.EtcYnShippingInfo;
import com.czmh.etc.onlinepubsys.json.JsonResult;

/**
 * @ClassName：DianApplyClient
 * @Description：云通卡开发服务
 * @Author： sevenchen.
 * @Date：2019-11-01 15:13:34
 * @Version：1.0.0
 */
@FeignClient(name = "DianApplyClient",
        url = NewrunConstants.FETCH_DOMAIN + "/api/dian/",
        fallback = DianApplyClient.DefaultFallback.class
)
public interface DianApplyClient {
    /**
     * 微信登录
     * 
     * @param channelId
     * @param code
     * @param openId
     * @return
     */
    @PostMapping(value = "loginByWx")
    JsonResult loginByWx(@RequestParam(required = false) String channelId, @RequestParam(required = false)String code, @RequestParam(required = false)String openId);
    
    /**
     * 获取obu申办ID
     * 
     * @return
     */
    @GetMapping(value = "obuapply")
    JsonResult obuapply();
    
    /**
     * 保存申请信息
     *
     * @param saveApplyReqDTO
     * @return
     */
    @PostMapping(value = "saveYnApplyInfo")
    JsonResult saveYnApplyInfo(@RequestBody EtcYnApplyInfoVO saveApplyReqDTO);

    /**
     * 省对省银行签约
     * @param applyId        申请表id
     * @param bankId         省对省可签约列表中获取的银行号，001是工行
     * @param miniRedirect   回调地址
     * @param userPhone      银行预留手机号
     * @return
     */
    @PostMapping(value = "banksign")
    JsonResult banksign(@RequestParam(required = false)String applyId, @RequestParam(required = false)String bankId, @RequestParam(required = false)String miniRedirect, @RequestParam(required = false)String userPhone);

    /**
     * 添加收货信息
     *
     * @param shippingInfo
     * @return
     */
    @PostMapping(value = "addShippingInfo")
    JsonResult addShippingInfo(@RequestBody EtcYnShippingInfo shippingInfo);
    
    /**
     * 银行卡绑定成功后修改状态
     * 
     * @param niurunApplyId
     * @return
     */
    @GetMapping(value = "changeStatus/{applyId}")
    JsonResult changeStatus(@PathVariable String applyId);
    
    public class DefaultFallback implements DianApplyClient {

        @Override
        public JsonResult loginByWx(String channelId, String code, String openId) {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public JsonResult obuapply() {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public JsonResult saveYnApplyInfo(EtcYnApplyInfoVO saveApplyReqDTO) {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public JsonResult banksign(String applyId, String bankId, String miniRedirect, String userPhone) {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public JsonResult addShippingInfo(EtcYnShippingInfo shippingInfo) {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public JsonResult changeStatus(String niurunApplyId) {
            // TODO Auto-generated method stub
            return null;
        }
    }
}
